home *** CD-ROM | disk | FTP | other *** search
- ========================
- Ch 13 − Subset databases
- ========================
-
- Subset databases are fully-working Powerbase databases with exactly the same
- structure as the main database but containing only a selection of its
- records.
-
- 13.1 Creating a subset
- -------------------------
- Creating a subset is extremely simple. Choose Export subset from the main
- menu and you will see a window strongly resembling the one used to export
- CSV files. It features our old friend the Query panel into which you type a
- search formula which determines the records to be exported as a subset.
-
- It is then only necessary to enter a suitable filename and drag the
- database icon to a filer window. The default pathname creates the new
- database as !Subset in PrintJobs. That’s probably not where you want it, but
- it is at least a familiar location from which you can extract the subset
- database later. You can accept this default by just clicking on Export or
- typing Return. Records are exported from the currently-selected subfile and
- will be placed in the corresponding subfile of the subset database.
-
- On opening the new database you will find that it functions exactly
- like the original but contains only the selected records. It is made just
- large enough to contain the selected records so you will need to increase
- its length (see 10.5) if you intend to add any further records.
-
- 13.2 Using a subset to shorten a database
- --------------------------------------------
- A database which has undergone a lot of deletions might have blank records
- scattered at random throughout its Database file and unused keys scattered
- at random throughout its indices. If a database has 100 available records
- of which only 50 are in use you might want to get rid of the surplus records
- but aren’t able to do so by the simple shortening procedure described in Ch
- 10.5 because that only allows you to lop off the end of the database. The
- amount by which the database can be shortened is often much less than the
- number of in-use records would suggest: in extreme cases you might not be
- able to shorten it at all by this method. (Don’t be afraid to try, however.
- Powerbase won’t let you butcher your database; it just tells you you can’t
- do it.)
-
- The solution to the problem is to export all the records as a
- subset. Simply follow the instructions in 13.1 but don’t type anything into
- the query panel. The resulting subset will contain the 50 in-use records
- and no extras at all.
-
- There is a snag, unfortunately. The Export subset feature operates
- only on the current subfile. If your database uses more than one subfile
- things are a little more difficult. You could accumulate all the records in
- subfile 0 (see 2.5.6), export the subset then move the records into the
- required subfiles. Or you could export each subfile as a separate subset
- (the records in the subsets will be in the same subfiles as in the original
- database) and then merge the resulting subsets into one new database (see
- 10.4).
-
- - 57 -
-
-
-
-
-
-
-
-
-
-